﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

using XCode;
using BingZi.HY.Core;

namespace BingZi.HY.Core
{
	/// <summary>
	/// 模块扩展权限
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("模块扩展权限")]
	[BindTable("sys_ModuleExtPermission", Description = "模块扩展权限", ConnName = "System")]
	public partial class sys_ModuleExtPermission
	{
		#region 属性
		private Int32 _ExtPermissionID;
		/// <summary>
		/// 扩展权限ID
		/// </summary>
		[Description("扩展权限ID")]
		[DataObjectField(false, true, false, 10)]
		[BindColumn(1, "ExtPermissionID", "扩展权限ID", "", "int", 10, 0, false)]
		public Int32 ExtPermissionID
		{
			get { return _ExtPermissionID; }
			set { if (OnPropertyChanging("ExtPermissionID", value)) { _ExtPermissionID = value;   } }
		}

		private Int32 _ModuleID;
		/// <summary>
		/// 模块ID
		/// </summary>
		[Description("模块ID")]
		[DataObjectField(true, false, false, 10)]
		[BindColumn(2, "ModuleID", "模块ID", "", "int", 10, 0, false)]
		public Int32 ModuleID
		{
			get { return _ModuleID; }
			set { if (OnPropertyChanging("ModuleID", value)) { _ModuleID = value;   } }
		}

		private String _PermissionName;
		/// <summary>
		/// 权限名称
		/// </summary>
		[Description("权限名称")]
		[DataObjectField(false, false, false, 100)]
		[BindColumn(3, "PermissionName", "权限名称", "", "nvarchar(100)", 0, 0, true)]
		public String PermissionName
		{
			get { return _PermissionName; }
			set { if (OnPropertyChanging("PermissionName", value)) { _PermissionName = value;   } }
		}

		private Int32 _PermissionValue;
		/// <summary>
		/// 权限值
		/// </summary>
		[Description("权限值")]
		[DataObjectField(true, false, false, 10)]
		[BindColumn(4, "PermissionValue", "权限值", "", "int", 10, 0, false)]
		public Int32 PermissionValue
		{
			get { return _PermissionValue; }
			set { if (OnPropertyChanging("PermissionValue", value)) { _PermissionValue = value;   } }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "ExtPermissionID" : return _ExtPermissionID;
					case "ModuleID" : return _ModuleID;
					case "PermissionName" : return _PermissionName;
					case "PermissionValue" : return _PermissionValue;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "ExtPermissionID" : _ExtPermissionID = Convert.ToInt32(value); break;
					case "ModuleID" : _ModuleID = Convert.ToInt32(value); break;
					case "PermissionName" : _PermissionName = Convert.ToString(value); break;
					case "PermissionValue" : _PermissionValue = Convert.ToInt32(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得模块扩展权限字段名的快捷方式
		/// </summary>
        [CLSCompliant(false)]
		public class _
		{
			///<summary>
			/// 扩展权限ID
			///</summary>
			public const String ExtPermissionID = "ExtPermissionID";

			///<summary>
			/// 模块ID
			///</summary>
			public const String ModuleID = "ModuleID";

			///<summary>
			/// 权限名称
			///</summary>
			public const String PermissionName = "PermissionName";

			///<summary>
			/// 权限值
			///</summary>
			public const String PermissionValue = "PermissionValue";
		}
		#endregion
	}
}